package domd2;

import java.util.Scanner;



public class LoginRoot {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
       try{
           System.out.println("输入用户名:");
           String name=input.next();
           System.out.println("输入密码:");
           String passwod=input.next();
           Checkpasswodname(passwod,name);
       }catch (Login E){
          E.printStackTrace();
       }
    }

    private static void Checkpasswodname(String passwod,String name) {
        String Passwod="123";
        String root="admin";
        if(name!=root){
            throw new Login("输入账号错误！");
        }
        if(passwod!=Passwod){
            throw new Login("输入密码错误!");
        }
    }
}
